#pragma once
#include <thread>
#include <condition_variable>
#include <mutex>
#include <list>
#include <iostream>
#include <string>
#include <vector>

class WorkThread;

class BROKEN_Task
{
public:
	BROKEN_Task();
	virtual void executeTask() = 0;
private:

};

class BROKEN_ThreadPool
{
public:
	BROKEN_ThreadPool();
	BROKEN_ThreadPool(int threadNum);
	~BROKEN_ThreadPool();

	void pushNewJob(BROKEN_Task* job);

	std::condition_variable *getHaveJob();
	std::mutex *getJobsMutex();
	std::list<BROKEN_Task* >* getJobsList();
private:
	std::vector<WorkThread*> m_workThread;

	std::condition_variable *m_haveJob;
	std::mutex *m_jobsMutex;
	std::list<BROKEN_Task* >* m_jobsList;
};

class WorkThread {

public:
	WorkThread(BROKEN_ThreadPool *threadPool);
	void run();
	//virtual void processWork(std::string work);
	~WorkThread();

	
private:
	bool pauseFlag = false;
	std::thread *m_workThread;
	std::list<BROKEN_Task* > *m_jobsList;
	std::mutex *m_mutex;
	std::condition_variable *m_haveJob;
};


